package com.example.springbootdemo.dao;
import com.example.springbootdemo.bean.UserBean;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class UserRowMapper implements RowMapper<UserBean> {
    @Override
    public UserBean mapRow(ResultSet resultSet, int i) throws SQLException {
        UserBean user = new UserBean();
        user.setId(resultSet.getInt("id"));
        user.setUserName(resultSet.getString("username"));
        return user;
    }
}
